/*
 * Copyright 2014 mango.jfaster.org
 *
 * The Mango Project licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package org.jfaster.mango.support;

import org.jfaster.mango.annotation.Cache;
import org.jfaster.mango.operator.cache.CacheExpire;

import java.lang.annotation.Annotation;

/**
 * @author ash
 */
public class MockCache implements Annotation, Cache {

  private String prefix;
  private Class<? extends CacheExpire> expire;
  private int num = 1;

  public MockCache(String prefix, Class<? extends CacheExpire> expire) {
    this.prefix = prefix;
    this.expire = expire;
  }

  public MockCache(String prefix, Class<? extends CacheExpire> expire, int num) {
    this.prefix = prefix;
    this.expire = expire;
    this.num = num;
  }

  @Override
  public String prefix() {
    return prefix;
  }

  @Override
  public Class<? extends CacheExpire> expire() {
    return expire;
  }

  @Override
  public int num() {
    return num;
  }

  @Override
  public boolean cacheNullObject() {
    return false;
  }

  @Override
  public boolean cacheEmptyList() {
    return true;
  }

  @Override
  public Class<? extends Annotation> annotationType() {
    throw new UnsupportedOperationException();
  }

}
